package subject_set.lc200;

/**
 * @author haomin
 * @date 2022/12/14 23:28
 **/
public class Num11 {
    class Solution {
        public int maxArea(int[] height) {
            int l = 0, r = height.length - 1, res = 0;
            while(l < r) {
                res = height[l] < height[r] ?
                        Math.max(res, (r-l) * height[l++]) :
                        Math.max(res, (r-l) * height[r--]) ;
            }
            return res;
        }
    }
}